package net.huashitong.ssydt.provider.pk.service;


import net.huashitong.ssydt.base.dao.LongMapper;
import net.huashitong.ssydt.base.service.AbstractLongService;
import net.huashitong.ssydt.pk.entity.SsPkYmdxChallengeRecord;
import net.huashitong.ssydt.provider.pk.dto.QinxueDTO;
import net.huashitong.ssydt.provider.pk.mapper.SsPkYmdxChallengeRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.12.12
 */
@Service
@Transactional
public class SsPkYmdxChallengeRecordServiceImpl extends AbstractLongService<SsPkYmdxChallengeRecord> implements SsPkYmdxChallengeRecordService {

    private SsPkYmdxChallengeRecordMapper mapper;

    @Autowired
    public SsPkYmdxChallengeRecordServiceImpl(SsPkYmdxChallengeRecordMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    protected LongMapper<SsPkYmdxChallengeRecord> getLongMapper() {
        return this.mapper;
    }

    @Override
    public int countDistinctUserIdByMatchRecordId(Long matchRecordId) {
        return this.mapper.countDistinctUserIdByMatchRecordId(matchRecordId);
    }

    @Override
    public List<String> findUserIdByQinxue(String sevenDayAgo, String nowDate) {
        return this.mapper.findUserIdByQinxue(new QinxueDTO(sevenDayAgo, nowDate));
    }
}
